package c.c.c.a.a;

import c.c.c.a.i.h;
import c.c.c.a.i.i;
import com.huawei.agconnect.exception.AGCServerException;
import java.io.File;

/* compiled from: ANRThread */
public class b implements Runnable {
    public final a a;
    public volatile boolean b = false;
    public Runnable c = new a();

    /* compiled from: ANRThread */
    public class a implements Runnable {
        public void run() {
            b.this.b = false;
        }
    }

    public b(a aVar) {
        this.a = aVar;
        File file = new File("/data/anr/traces.txt");
        if (file.exists()) {
            file.lastModified();
        }
        i.a(2);
        h.a().b(4500, this.c, 1, 0);
        h.a().b(5000, this, 40, 5000);
    }

    public void run() {
        if (!this.b) {
            int i;
            String str = "/data/anr/traces.txt";
            File file = new File(str);
            Object obj = (file.exists() && file.canRead()) ? 1 : null;
            if (obj != null) {
                i = AGCServerException.OK;
            } else {
                str = null;
                i = 100;
            }
            if (this.a.b(i, str, 25)) {
                this.b = true;
            }
        }
    }
}
